export interface User {
  id: string;
  username: string;
  phone?: string;
  email?: string;
  avatar?: string;
  role?: 'user' | 'admin';
  [k: string]: unknown;
}


export interface UserResponse {
  id: string;
  username: string;
  phone?: string;
  email?: string;
  avatar?: string;
  role?: 'user' | 'admin';
  [k: string]: unknown;
}


export interface LoginRequest {
  username_or_phone: string;
  password?: string;
  verification_code?: string;
  [k: string]: unknown;
}


export interface LoginResponse {
  message: string;
  access_token: string;
  refresh_token: string;
  user: {
    id: string;
    username: string;
    phone?: string;
    email?: string;
    avatar?: string;
    role?: 'user' | 'admin';
    [k: string]: unknown;
  };
  [k: string]: unknown;
}


export interface VerificationCodeRequest {
  phone: string;
  verification_code: string;
  [k: string]: unknown;
}


export interface RegisterRequest {
  username: string;
  password: string;
  phone: string;
  [k: string]: unknown;
}


export interface ResetPasswordRequest {
  phone: string;
  verification_code: string;
  new_password: string;
  [k: string]: unknown;
}


export interface MessageResponse {
  message: string;
  [k: string]: unknown;
}


export interface RefreshTokenRequest {
  refresh_token: string;
  [k: string]: unknown;
}


export interface RefreshTokenResponse {
  access_token: string;
  refresh_token: string;
  [k: string]: unknown;
}


export interface LogoutRequest {
  access_token?: string;
  refresh_token?: string;
  [k: string]: unknown;
}


export interface TokenVerifyResponse {
  valid: boolean;
  user: {
    id: string;
    username: string;
    phone?: string;
    email?: string;
    avatar?: string;
    role?: 'user' | 'admin';
    [k: string]: unknown;
  };
  [k: string]: unknown;
}


export interface ChangePasswordRequest {
  old_password: string;
  new_password: string;
  [k: string]: unknown;
}


export interface SendVerificationCodeRequest {
  phone: string;
  /**
   * 验证码类型：register-注册, login-登录, reset-重置密码
   */
  type: 'register' | 'login' | 'reset';
  [k: string]: unknown;
}


export interface SendVerificationCodeResponse {
  message: string;
  /**
   * 验证码有效期（秒）
   */
  expire_in: number;
  [k: string]: unknown;
}
